package com.zzx.util;

import org.springframework.beans.BeanUtils;

import java.lang.reflect.InvocationTargetException;

public class MyBeanUtils {


    public static <T> T copyProperties(Object source,Class<T> target){
        T t1 = null;
        try {
            t1 = target.getDeclaredConstructor().newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        BeanUtils.copyProperties(source,t1);

         return t1;
    }

}
